$(function() {
  // Contact Form
  // Validation
  $("#sky-form3").validate({
      // Rules for form validation
      rules: {
        name: {
          required: true
        },
        message: {
          required: true,
          minlength: 10
        },
      },

      // Messages for form validation
      messages: {
        name: {
          required: 'Please enter your name',
        },
        message: {
          required: 'Please enter your message'
        },
      },

      // Ajax form submition
      submitHandler: function(form) {
        $(form).ajaxSubmit( {
          beforeSend: function() {
            $('#sky-form3 button[type="submit"]').attr('disabled', true);
          },
          success: function() {
            $("#sky-form3").addClass('submited');
          }
        });
      },

      // Do not change code below
      errorPlacement: function(error, element) {
        error.insertAfter(element.parent());
      }
  });
});